//导入vue 
import Vue from 'vue'
//导入了vuex
import Vuex from 'vuex'

Vue.use(Vuex)
//导入了vuex 实例对象
export default new Vuex.Store({
  //1.state:负责存储数据
  state: {
    userInfo: {}
  },
  //2.mutations :  负责修改state中的数据
  mutations: {
    updateUserInfo(state, newData) {
      state.userInfo = newData
    }

  },
  actions: {},
  modules: {}
})
